<template>
  <div class="app-container btn">
    <el-form
      :model="queryParams"
      ref="queryForm"
      :inline="true"
      v-show="showSearch"
      label-width="100px"
    >
      <el-form-item label="导入表行id" prop="reaction">
        <el-input
          v-model="queryParams.reaction"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="reactionorigin">
        <el-input
          v-model="queryParams.reactionorigin"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="reactants">
        <el-input
          v-model="queryParams.reactants"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="reactantsSmiles">
        <el-input
          v-model="queryParams.reactantsSmiles"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="reactantsFormula">
        <el-input
          v-model="queryParams.reactantsFormula"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="products">
        <el-input
          v-model="queryParams.products"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="productsSmiles">
        <el-input
          v-model="queryParams.productsSmiles"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="productsFormula">
        <el-input
          v-model="queryParams.productsFormula"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="a">
        <el-input
          v-model="queryParams.a"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="n">
        <el-input
          v-model="queryParams.n"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="e">
        <el-input
          v-model="queryParams.e"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="a2">
        <el-input
          v-model="queryParams.a2"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="e2">
        <el-input
          v-model="queryParams.e2"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="r2">
        <el-input
          v-model="queryParams.r2"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="tkvalue">
        <el-input
          v-model="queryParams.tkvalue"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="temp">
        <el-input
          v-model="queryParams.temp"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="tempOrig">
        <el-input
          v-model="queryParams.tempOrig"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="tempModify">
        <el-input
          v-model="queryParams.tempModify"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="authors">
        <el-input
          v-model="queryParams.authors"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="title">
        <el-input
          v-model="queryParams.title"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="journal">
        <el-input
          v-model="queryParams.journal"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="volume">
        <el-input
          v-model="queryParams.volume"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="pages">
        <el-input
          v-model="queryParams.pages"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="year">
        <el-input
          v-model="queryParams.year"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="referencetype">
        <el-select
          v-model="queryParams.referencetype"
          placeholder="请选择导入表行id"
          clearable
          size="small"
        >
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="导入表行id" prop="source">
        <el-input
          v-model="queryParams.source"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="confidence">
        <el-input
          v-model="queryParams.confidence"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="plog">
        <el-input
          v-model="queryParams.plog"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="reactantsCasnum">
        <el-input
          v-model="queryParams.reactantsCasnum"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="productsCasnum">
        <el-input
          v-model="queryParams.productsCasnum"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="ismissing">
        <el-input
          v-model="queryParams.ismissing"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="aneiserror">
        <el-input
          v-model="queryParams.aneiserror"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="order">
        <el-input
          v-model="queryParams.order"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="search">
        <el-input
          v-model="queryParams.search"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="fromType">
        <el-select
          v-model="queryParams.fromType"
          placeholder="请选择导入表行id"
          clearable
          size="small"
        >
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="导入表名" prop="sourceTable">
        <el-input
          v-model="queryParams.sourceTable"
          placeholder="请输入导入表名"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="导入表行id" prop="sourceId">
        <el-input
          v-model="queryParams.sourceId"
          placeholder="请输入导入表行id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建时间" prop="createTime">
        <el-date-picker
          clearable
          size="small"
          v-model="queryParams.createTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择创建时间"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          >搜索</el-button
        >
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
          >重置</el-button
        >
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:info:add']"
          >新增</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:info:edit']"
          >修改</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:info:remove']"
          >删除</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          :loading="exportLoading"
          @click="handleExport"
          v-hasPermi="['system:info:export']"
          >导出</el-button
        >
      </el-col>
      <right-toolbar
        :showSearch.sync="showSearch"
        @queryTable="getList"
      ></right-toolbar>
    </el-row>

    <el-table
      :header-cell-style="{ 'font-size': '17px' }"
      style="width: 100%; font-size: 17px"
      v-loading="loading"
      :data="infoList"
      @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="创建时间" align="center" prop="id" />
      <el-table-column label="创建时间" align="center" prop="reaction" />
      <el-table-column label="创建时间" align="center" prop="reactionorigin" />
      <el-table-column label="创建时间" align="center" prop="reactants" />
      <el-table-column label="创建时间" align="center" prop="reactantsSmiles" />
      <el-table-column
        label="创建时间"
        align="center"
        prop="reactantsFormula"
      />
      <el-table-column label="创建时间" align="center" prop="products" />
      <el-table-column label="创建时间" align="center" prop="productsSmiles" />
      <el-table-column label="创建时间" align="center" prop="productsFormula" />
      <el-table-column label="创建时间" align="center" prop="a" />
      <el-table-column label="创建时间" align="center" prop="n" />
      <el-table-column label="创建时间" align="center" prop="e" />
      <el-table-column label="创建时间" align="center" prop="a2" />
      <el-table-column label="创建时间" align="center" prop="e2" />
      <el-table-column label="创建时间" align="center" prop="r2" />
      <el-table-column label="创建时间" align="center" prop="tkvalue" />
      <el-table-column label="创建时间" align="center" prop="temp" />
      <el-table-column label="创建时间" align="center" prop="tempOrig" />
      <el-table-column label="创建时间" align="center" prop="tempModify" />
      <el-table-column label="创建时间" align="center" prop="authors" />
      <el-table-column label="创建时间" align="center" prop="title" />
      <el-table-column label="创建时间" align="center" prop="journal" />
      <el-table-column label="创建时间" align="center" prop="volume" />
      <el-table-column label="创建时间" align="center" prop="pages" />
      <el-table-column label="创建时间" align="center" prop="year" />
      <el-table-column label="创建时间" align="center" prop="referencetype" />
      <el-table-column label="创建时间" align="center" prop="source" />
      <el-table-column label="创建时间" align="center" prop="confidence" />
      <el-table-column label="创建时间" align="center" prop="plog" />
      <el-table-column label="创建时间" align="center" prop="reactantsCasnum" />
      <el-table-column label="创建时间" align="center" prop="productsCasnum" />
      <el-table-column label="创建时间" align="center" prop="ismissing" />
      <el-table-column label="创建时间" align="center" prop="aneiserror" />
      <el-table-column label="创建时间" align="center" prop="order" />
      <el-table-column label="创建时间" align="center" prop="search" />
      <el-table-column label="创建时间" align="center" prop="fromType" />
      <el-table-column label="分子结构存储路径" align="center" prop="mol" />
      <el-table-column label="导入表名" align="center" prop="sourceTable" />
      <el-table-column label="导入表行id" align="center" prop="sourceId" />
      <el-table-column
        label="创建时间"
        align="center"
        prop="createTime"
        width="180"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
      >
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:info:edit']"
            >修改</el-button
          >
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:info:remove']"
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>

    <pagination
      class="pagination_style"
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改动力学数据对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="创建时间" prop="reaction">
          <el-input v-model="form.reaction" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="reactionorigin">
          <el-input
            v-model="form.reactionorigin"
            placeholder="请输入创建时间"
          />
        </el-form-item>
        <el-form-item label="创建时间" prop="reactants">
          <el-input v-model="form.reactants" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="reactantsSmiles">
          <el-input
            v-model="form.reactantsSmiles"
            placeholder="请输入创建时间"
          />
        </el-form-item>
        <el-form-item label="创建时间" prop="reactantsFormula">
          <el-input
            v-model="form.reactantsFormula"
            placeholder="请输入创建时间"
          />
        </el-form-item>
        <el-form-item label="创建时间" prop="products">
          <el-input v-model="form.products" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="productsSmiles">
          <el-input
            v-model="form.productsSmiles"
            placeholder="请输入创建时间"
          />
        </el-form-item>
        <el-form-item label="创建时间" prop="productsFormula">
          <el-input
            v-model="form.productsFormula"
            placeholder="请输入创建时间"
          />
        </el-form-item>
        <el-form-item label="创建时间" prop="a">
          <el-input v-model="form.a" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="n">
          <el-input v-model="form.n" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="e">
          <el-input v-model="form.e" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="a2">
          <el-input v-model="form.a2" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="e2">
          <el-input v-model="form.e2" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="r2">
          <el-input v-model="form.r2" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="tkvalue">
          <el-input v-model="form.tkvalue" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="temp">
          <el-input v-model="form.temp" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="tempOrig">
          <el-input v-model="form.tempOrig" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="tempModify">
          <el-input v-model="form.tempModify" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="authors">
          <el-input v-model="form.authors" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="title">
          <el-input v-model="form.title" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="journal">
          <el-input v-model="form.journal" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="volume">
          <el-input v-model="form.volume" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="pages">
          <el-input v-model="form.pages" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="year">
          <el-input v-model="form.year" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="referencetype">
          <el-select v-model="form.referencetype" placeholder="请选择创建时间">
            <el-option label="请选择字典生成" value="" />
          </el-select>
        </el-form-item>
        <el-form-item label="创建时间" prop="source">
          <el-input v-model="form.source" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="confidence">
          <el-input v-model="form.confidence" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="plog">
          <el-input v-model="form.plog" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="reactantsCasnum">
          <el-input
            v-model="form.reactantsCasnum"
            placeholder="请输入创建时间"
          />
        </el-form-item>
        <el-form-item label="创建时间" prop="productsCasnum">
          <el-input
            v-model="form.productsCasnum"
            placeholder="请输入创建时间"
          />
        </el-form-item>
        <el-form-item label="创建时间" prop="ismissing">
          <el-input v-model="form.ismissing" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="aneiserror">
          <el-input v-model="form.aneiserror" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="order">
          <el-input v-model="form.order" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="search">
          <el-input v-model="form.search" placeholder="请输入创建时间" />
        </el-form-item>
        <el-form-item label="创建时间" prop="fromType">
          <el-select v-model="form.fromType" placeholder="请选择创建时间">
            <el-option label="请选择字典生成" value="" />
          </el-select>
        </el-form-item>
        <el-form-item label="分子结构存储路径" prop="mol">
          <el-input
            v-model="form.mol"
            type="textarea"
            placeholder="请输入内容"
          />
        </el-form-item>
        <el-form-item label="导入表名" prop="sourceTable">
          <el-input v-model="form.sourceTable" placeholder="请输入导入表名" />
        </el-form-item>
        <el-form-item label="导入表行id" prop="sourceId">
          <el-input v-model="form.sourceId" placeholder="请输入导入表行id" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  listInfo,
  getInfo,
  delInfo,
  addInfo,
  updateInfo,
  exportInfo,
} from "@/api/system/info";

export default {
  name: "Info",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 动力学数据表格数据
      infoList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        reaction: null,
        reactionorigin: null,
        reactants: null,
        reactantsSmiles: null,
        reactantsFormula: null,
        products: null,
        productsSmiles: null,
        productsFormula: null,
        a: null,
        n: null,
        e: null,
        a2: null,
        e2: null,
        r2: null,
        tkvalue: null,
        temp: null,
        tempOrig: null,
        tempModify: null,
        authors: null,
        title: null,
        journal: null,
        volume: null,
        pages: null,
        year: null,
        referencetype: null,
        source: null,
        confidence: null,
        plog: null,
        reactantsCasnum: null,
        productsCasnum: null,
        ismissing: null,
        aneiserror: null,
        order: null,
        search: null,
        fromType: null,
        mol: null,
        sourceTable: null,
        sourceId: null,
        createTime: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {},
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询动力学数据列表 */
    getList() {
      this.loading = true;
      listInfo(this.queryParams).then((response) => {
        this.infoList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        reaction: null,
        reactionorigin: null,
        reactants: null,
        reactantsSmiles: null,
        reactantsFormula: null,
        products: null,
        productsSmiles: null,
        productsFormula: null,
        a: null,
        n: null,
        e: null,
        a2: null,
        e2: null,
        r2: null,
        tkvalue: null,
        temp: null,
        tempOrig: null,
        tempModify: null,
        authors: null,
        title: null,
        journal: null,
        volume: null,
        pages: null,
        year: null,
        referencetype: null,
        source: null,
        confidence: null,
        plog: null,
        reactantsCasnum: null,
        productsCasnum: null,
        ismissing: null,
        aneiserror: null,
        order: null,
        search: null,
        fromType: null,
        mol: null,
        sourceTable: null,
        sourceId: null,
        createTime: null,
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.id);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加动力学数据";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids;
      getInfo(id).then((response) => {
        this.form = response.data;
        this.open = true;
        this.title = "修改动力学数据";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (this.form.id != null) {
            updateInfo(this.form).then((response) => {
              this.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addInfo(this.form).then((response) => {
              this.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$confirm(
        '是否确认删除动力学数据编号为"' + ids + '"的数据项?',
        "警告",
        {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        }
      )
        .then(function () {
          return delInfo(ids);
        })
        .then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        })
        .catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$confirm("是否确认导出所有动力学数据数据项?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.exportLoading = true;
          return exportInfo(queryParams);
        })
        .then((response) => {
          this.download(response.msg);
          this.exportLoading = false;
        })
        .catch(() => {});
    },
  },
};
</script>

<style lang="scss" scoped>
::v-deep .el-form-item__label {
  font-size: 17px;
}
::v-deep .mb8 .el-button {
  font-size: 16px;
}
::v-deep .el-form .el-button {
  font-size: 16px;
}

::v-deep .el-form .el-form-item {
  .el-form-item__error {
    width: 120px;
  }
}

::v-deep .el-dialog .el-form-item__label {
  width: 30px;
}

//去除input number样式
::v-deep input::-webkit-outer-spin-button,
::v-deep input::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
}
::v-deep input[type="number"] {
  -moz-appearance: textfield !important;
}
::v-deep .el-dialog .el-input__inner {
  width: 300px;
  line-height: 1px !important;
}

.element.style {
  width: 100px;
  min-width: 100px;
}

.app-container {
  background: rgb(254, 254, 254);
}

.pagination_style {
  height: 70px;
  margin-right: 40px;
}

.btn {
  .el-button {
    margin-left: 10px;
    margin-right: 5px;
  }
}
</style>
